<template>
  <j-select-biz-component :width="1000" v-bind="configs" :buttons='buttons' :queryParams='queryParams' v-on="$listeners"/>
</template>

<script>
  import JSelectBizComponent from './JSelectBizComponent'

  export default {
    name: 'JSelectProduct',
    components: { JSelectBizComponent },
    props: {
      value: {
        type: String,
        default: ''
      },
      name: {
        type: String,
        default: '经销商'
      },
      selectButtonText:{
        type: String,
        default: '选择'
      },
      inputs:{
        type: Boolean,
        default: true
      },
      searchIcon:{
        type: String,
        default: 'search'
      },
      queryConfig:{
        type:Array,
        default:()=>[
          {
            label: '商品编号',
            key: 'goodsCode'
          },
        ]
      },
      listUrl:{
        type:String,
        default: '/goods/cnGoods/findPageList',
      },
      multiple:{
        type: Boolean,
        default: true
      },
      buttons:{
        type:Boolean,
        default:true
      },
      returnName:{
        type:Boolean,
        default:false
      },
      returnNameKey:{
        type:Boolean,
        default:false
      }
    },
    data() {
      return {
        settings: {
          name: '产品',
          displayKey: 'goodsName',
          returnKeys: ['id', 'goodsCode'],
          queryParamCode: 'goodsName',
          queryParamText: '产品名称',
          ellipsisLength:-1,
          columns: [
            { title: '产品名称', field: 'goodsName', align: 'center', width: '50%', widthRight: '70%' },
            { title: '产品编号', field: 'goodsCode', align: 'center', width: '50%' },
          ]
        }
      }
    },
    computed: {
      configs() {
        return Object.assign({ value: this.value,listUrl:this.listUrl }, this.settings, this.$attrs)
      }
    }
  }
</script>

<style lang="less" scoped></style>